import request from '@/utils/request'

// 创建不良品处理
export function createNcrRecord(data) {
  return request({
    url: '/quality/ncr-record/create',
    method: 'post',
    data: data
  })
}

// 审核
export function audit(data) {
  return request({
    url: '/quality/ncr-record/audit',
    method: 'post',
    data: data
  })
}


// 更新不良品处理
export function updateNcrRecord(data) {
  return request({
    url: '/quality/ncr-record/update',
    method: 'put',
    data: data
  })
}

// 删除不良品处理
export function deleteNcrRecord(id) {
  return request({
    url: '/quality/ncr-record/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除不良品处理 */
export function deleteNcrRecordList(ids) {
  return request({
    url: `/quality/ncr-record/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得不良品处理
export function getNcrRecord(id) {
  return request({
    url: '/quality/ncr-record/get?id=' + id,
    method: 'get'
  })
}

// 获得不良品处理分页
export function getNcrRecordPage(params) {
  return request({
    url: '/quality/ncr-record/page',
    method: 'get',
    params
  })
}
// 导出不良品处理 Excel
export function exportNcrRecordExcel(params) {
  return request({
    url: '/quality/ncr-record/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
